using MessengerAPI;

namespace TfsCommunity.Collaboration.MessengerMod
{
    public class UserPresenter
    {
        private readonly IMessengerContact _user;

        public UserPresenter(IMessengerContact user)
        {
            _user = user;
        }

        public IMessengerContact User
        {
            get { return _user; }
        }

        public string DisplayName
        {
            get
            {
                if (_user == null)
                    return "No Messenger User attached";

                return string.Format("{0} ({1})",
                                     string.IsNullOrEmpty(_user.FriendlyName) ? "<no full name>" : _user.FriendlyName,
                                     _user.SigninName);
            }
        }
    }
}